package com.tsingteng.cosfun.ui.cosfun.imodel;

import com.tsingteng.cosfun.bean.AttentRecommendbean;
import com.tsingteng.cosfun.bean.BaseDataBean;
import com.tsingteng.cosfun.bean.BlindResp;
import com.tsingteng.cosfun.bean.CommBackBean;
import com.tsingteng.cosfun.bean.FollowBean;
import com.tsingteng.cosfun.bean.FoundAtBean;
import com.tsingteng.cosfun.bean.HomeBean;
import com.tsingteng.cosfun.bean.JoinCostarBean;
import com.tsingteng.cosfun.bean.OpusBean;
import com.tsingteng.cosfun.bean.RecommenResp;
import com.tsingteng.cosfun.bean.SearchResp;
import com.tsingteng.cosfun.callback.RxObserver;
import com.tsingteng.cosfun.common.Config;
import com.tsingteng.cosfun.common.Constant;
import com.tsingteng.cosfun.http.RxSchedulers;
import com.tsingteng.cosfun.mvp.module.BaseModel;

import java.util.List;

import retrofit2.Callback;

public class OpusModel extends BaseModel implements IOpusModel {
    @Override
    public void getOpusList(String page_no, String page_size, String timestamp, String sign, RxObserver<HomeBean> callback) {
        doRxRequest().getHomeData(page_no, page_size, timestamp, sign).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    @Override
    public void getOpusAttentionList(String page_no, String page_size, String deviceId, String c, RxObserver<BaseDataBean<String>> callback) {
        doRxRequest().getAttentionList(page_no, page_size, deviceId, c).compose(RxSchedulers.io_main()).subscribe(callback);

    }

    @Override
    public void getOpusAttention(String workId, String c, String deviceId, String type, RxObserver<BaseDataBean<String>> callback) {
        doRxRequest().getAttention(workId, c, deviceId, type).compose(RxSchedulers.io_main()).subscribe(callback);

    }

    @Override
    public void getOpusZan(String workId, String c, String deviceId, String type, RxObserver<CommBackBean> callback) {
        doRxRequest().getOpusZan(workId, c, deviceId, type).compose(RxSchedulers.io_main()).subscribe(callback);

    }

    @Override
    public void getCommmZan(String workId, String c, String deviceId, String type, RxObserver<BaseDataBean<String>> callback) {
        doRxRequest().getCommZan(workId, c, deviceId, type).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    ///
    @Override
    public void getLoseInterest(String workId, String timestamp, String type, RxObserver<CommBackBean> callback) {
        doRxRequest().getLoseInterest(workId, timestamp, type).compose(RxSchedulers.io_main()).subscribe(callback);

    }

    /**
     * 获取合拍的小视频
     *
     * @param video_info_id
     * @param callback
     */
    @Override
    public void getCostarVideoInfo(String video_info_id, RxObserver<JoinCostarBean> callback) {
        doRxRequest().getCostarVideoInfo(video_info_id).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    @Override
    public void getFoucsOpusList(String page_no, String page_size, String timestamp, String sign, RxObserver<HomeBean> callback) {
        doRxRequest().getFoucsData(page_no, page_size, timestamp, sign).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    //段子尬论视频列表
    @Override
    public void getXiPuVideoListList(String paragraph_id, String pageNo, String type, RxObserver<HomeBean.DataBean> callback) {
        doRxRequest().getXiPuVideoList(paragraph_id + "", pageNo, Config.PAGE_SIZE + "", type).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    @Override
    public void getFollowNotification(String id, Callback<BaseDataBean<FollowBean>> callback) {
        doRxRequest().followPerson(id).enqueue(callback);
    }


    @Override
    public void getWorkList(long userId, String c, String showType, String page_no, String page_size, String deviceId, Callback<BaseDataBean<HomeBean.DataBean>> callback) {
        doRxRequest().getWorks(userId, c, showType, page_no, page_size, deviceId).enqueue(callback);
    }

    @Override
    public void getGrade(String video_id, long timestamp, int video_time, Callback<BaseDataBean<String>> callback) {
        doRxRequest().getGrade(video_id, timestamp, video_time).enqueue(callback);

    }

    @Override
    public void getDel(String video_id, Callback<BaseDataBean<String>> callback) {
        doRxRequest().getDel(video_id).enqueue(callback);

    }

    @Override
    public void getVList(int id, String sortType, int pageNo, int pageSize, RxObserver<FoundAtBean> callback) {
        doRxRequest().getVideoList(id,sortType,pageNo,pageSize).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    @Override
    public void getCheckBlind(RxObserver<BlindResp> callback) {
       doRxRequest().getCheckUserPhone().compose(RxSchedulers.io_main()).subscribe(callback);
    }

    @Override
    public void getAddJoin(long video_id,RxObserver<BlindResp> callback) {
       doRxRequest().getCheckJoin(video_id).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    @Override
    public void getVideoInfo(String videoId, RxObserver<OpusBean> callback) {
        doRxRequest().getVideoInfo(videoId).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    @Override
    public void getFocusListInfo(RxObserver<RecommenResp> callback) {
        doRxRequest().getFocusList(Constant.PAY_ATTENTION_TO_MENU_RECOMMENDATION,Config.PAGE_NO,Config.PAGE_FIFTY).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    @Override
    public void getNoFollowNotification(String follow_id, RxObserver<FollowBean> callback) {
        doRxRequest().getNoFollow(follow_id).compose(RxSchedulers.io_main()).subscribe(callback);
    }

    @Override
    public void postCheckAndRemmond(String video_id, int opreate, RxObserver<String> callback) {
        doRxRequest().getRecommendAndCheck(video_id,opreate).compose(RxSchedulers.io_main()).subscribe(callback);
    }


}
